{extends file='layout/front.html'}

{block name='main'}
<script type="text/javascript" charset="utf-8">
$('.menu2').attr('class', 'menu2_cur');
</script>
<div class="main_t3"> </div>
<div class="main_c">
	<div class="main_top_btn_box pb5">
		<ul class="send_state">
			<li><a href="history.html" class="btn1{if !$smarty.get.t}_cur{/if}">默认</a></li>
			<li><a href="history.html?t=1" class="btn2{if $smarty.get.t==1}_cur{/if}">已发送</a></li>
			<li><a href="history.html?t=2" class="btn3{if $smarty.get.t==2}_cur{/if}">发送中</a></li>
		</ul>
	</div>
	<ul class="history_list">
	  {foreach $data as $val}
	  <li>
			{if $val.sent_time > 0}<div class="time_box green_bg">{date('Y-m-d', $val.sent_time)}<p>{date('H:i', $val.sent_time)}</p></div>{else}<div class="time_box red_bg">{date('Y-m-d', $val.send_time)}<p>{date('H:i', $val.send_time)}</p></div>{/if}
			<p class="msg">{$val.content}</p>
			<dl class="btn_box">
				<dd><a href="history/delete.html?id={$val.id}" class="btn1">删除</a></dd>
				{if $val.sent_time == 0}
				<dd><a href="{$val.id}" class="btn2 history_update">编辑</a></dd>
				<dd><a href="history/send.html?id={$val.id}" class="btn3">直接发送</a></dd>
				{/if}
			</dl>
		</li>
	  {/foreach}
	</ul>
</div>

<script type="text/javascript" charset="utf-8">
  $('.history_list .btn1').click(function(){
      return confirm('确定删除？');
  });


  $('.history_list .btn3').click(function(){
      return confirm('确定要马上发送？');
  });


$('.history_update').click(function(){
	var hid = $(this).attr('href');
	tweet_box('', hid);
	return false;
});
</script>
{/block}